package com.example.zproject.dao.impl;

import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import com.example.zproject.dao.UserDao;
import com.example.zproject.entity.UserEntity;

import java.sql.SQLException;

public class UserDaoimpl implements UserDao {

    @Override
    public void save(UserEntity user) throws SQLException {
        Entity set = Entity.create("user")
                .set("username", user.getUsername())
                .set("email", user.getEmail())
                .set("password", user.getPassword());

            Db.use().insert(set);
        System.out.println("保存成功!"+user.getUsername());
    }
}
